home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / util / misc / VMM_src.lha / VMM / lib / hook.asm < prev    next >
Encoding:
Assembly Source File  |  1995-01-15  |  1.1 KB  |  27 lines

  1.                     INCLUDE        "utility/hooks.i"
  2.  
  3.                     XDEF           _CallHook_C
  4.  
  5. _CallHook_C:        * Calls a C hook function. Normally hook functions
  6.                     * have to receive parameters in registers. For
  7.                     * compilers such as GNU C, which aren't capable
  8.                     * of specifying register arguments, this routine
  9.                     * may be used for h_Entry, the C routine has
  10.                     * to be stuffed into h_SubEntry
  11.                     *
  12.                     * Called with
  13.                     *    A0 - pointer to hook data structure itself
  14.                     *    A1 - pointer to parameter structure ("message")
  15.                     *    A2 - Hook specific address data ("object")
  16.                     *
  17.                     * The hook function has to be specified as
  18.                     * func (hook, message, object
  19.  
  20.                     movem.l   a0-a2,-(sp)
  21.                     move.l    h_SubEntry(a0),a0
  22.                     jsr       (a0)
  23.                     add.w     #12,sp
  24.                     rts
  25.  
  26.                     end
  27.